<template>
  <div>
    <el-table :data="form" style="width: 100%">
      <el-table-column prop="basicSalary" label="基础工资"> </el-table-column>
      <el-table-column prop="bonus" label="奖金"> </el-table-column>
      <el-table-column prop="taxDeduction" label="税收"> </el-table-column>
      <el-table-column prop="netSalary" label="实发工资"> </el-table-column>
      <el-table-column prop="userAdmin" label="发薪人"> </el-table-column>
      <el-table-column prop="createTime" label="时间">
        <template slot-scope="scope">
          {{ scope.row.createTime.replace('T', ' ') }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getUserSalar } from '@/api/salary';
import { getToken } from '@/utils/auth';
import { mapGetters } from 'vuex';
export default {
  created() {
    // console.log(1);
    // const Token = getToken();

    // console.log(2);
    // console.log(getToken());
    // console.log(3);
    // 获取个人薪水
    this.getSalarinfo();
  },
  methods: {
    getSalarinfo() {
      var Token = getToken();
      console.log(Token);
      getUserSalar(Token).then((resp) => {
        this.form = resp.data;
      });
    },
  },
  data() {
    return {
      form: [],
      dialogFormVisible: false,
      formLabelWidth: '120px',
      salar: [],
    };
  },
  computed: {
    ...mapGetters(['name']),
  },
};
</script>
